<%@page import="cz.acies.data.dao.*"%>
<%@page import="cz.acies.data.process.*"%>
<%@page import="org.apache.commons.beanutils.BeanUtils"%>
<%@ page language="java" session="true" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.google.gson.*"%>

<%@ page pageEncoding="UTF-8" %>
<% request.setCharacterEncoding("UTF-8");  %>
<% response.setCharacterEncoding("UTF-8");  %>
<%
Gson gson = new Gson();
Map<String, Object> params = new HashMap<String, Object>();
Enumeration<String> e = request.getParameterNames();
while (e.hasMoreElements()) {
	String key =  e.nextElement();
	params.put(key, request.getParameter(key));
}
System.out.println("user_process.params:"+params);

String processId = (String) params.get("processId");
System.out.println("user_process.processId:"+processId);
UserProcessor processor = new UserProcessor(); 
if (processId != null) {
	if (processId.equals("doAppend")) {
		String result = processor.doAppend(params);
		out.println(result);
	} else if (processId.equals("doUpdate")) {
		String result = processor.doUpdate(params);
		out.println(result);
	} else {
		processor.execute(request, response);
	}
} else {
	out.println("Chybí paramert processId?");
}
%>
